home *** CD-ROM | disk | FTP | other *** search
/ Scene 96 / Scene 96 International Edition (Zyklop Software) (Disc 1) (1997).iso / emulator / amiga065 / utils / source / makedisk.c
Encoding:
C/C++ Source or Header  |  1996-04-07  |  895 b   |  36 lines

  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <stdlib.h>
  4.  
  5. void main(int argc, char **argv) {
  6.     FILE *disk;
  7.     char *diskname;
  8.     long disksize=0;
  9.  
  10.     if(argc > 1) {
  11.         if(!stricmp(argv[1], "hf")) {
  12.         diskname="hardfile";
  13.         if(argc > 2)
  14.             disksize=(atol(argv[2])+16383)/16384*16384;
  15.         }
  16.         if(!stricmp(argv[1], "df")) {
  17.         diskname="diskfile";
  18.         disksize=901120;
  19.         }
  20.     }
  21.     if(!disksize) {
  22.         printf("MakeDisk  Version 0.02\xe1\n\n");
  23.         printf("Usage:\n\n");
  24.         printf("MakeDisk hf <size>\n");
  25.         printf("       Makes a large harfile of <size> bytes, <size> must be multiple of\n");
  26.         printf("       16384, otherwize it will be rounded up.\n\n");
  27.         printf("MakeDisk df\n");
  28.         printf("       Makes a small diskfile.\n");
  29.         exit(0);
  30.     }
  31.     disk = fopen(diskname, "wb");
  32.     fseek(disk, disksize-1, SEEK_SET);
  33.     fputc(0, disk);
  34.     fclose(disk);
  35. }
  36.